Release 10.1A: OpenEdge Development:
Internationalizing Applications
FORMAT phrase
The OpenEdge Data Dictionary Format field and the 4GL
FORMATphrase for character strings let you specify the display format in columns. For example, the character format “x(8)” can accommodate the following:Fitting multi-byte characters into the available columns
Before displaying or printing a multi-byte character, OpenEdge ensures that the display or print field contains enough columns to accommodate the entire multi-byte character. If there are not enough columns, OpenEdge does not display any of the multi-byte character and pads the columns of the display field or print field with spaces.
Note: OpenEdge neither splits nor truncates multi-byte characters to make them fit a display field.For example, suppose you use the following format string, which specifies a seven-byte character field:
You want to display the following character string, which consists of four double-byte characters:
OpenEdge displays the first three double-byte characters in columns 1 through 6 of the field and a space in column 7:
OpenEdge does not display any of the fourth double-byte character, not even its lead byte, because doing so would split its lead byte from its trail byte, and the character would not appear properly.
Fitting multi-byte characters around formatting characters
Before OpenEdge displays a multi-byte character, if the next byte in the format specification is a formatting character, such as a dash, OpenEdge inserts a space, then the dash, then searches the format specification for the next two available contiguous columns.
For example, suppose you use the following format, which consists of three bytes, a hyphen formatting character, and four bytes:
You want to display the following string, which consists of four double-byte characters:
The result is the following string, which consists of the first double-byte character, a blank, the hyphen formatting symbol, the second double-byte character, and third double-byte character:
To build the resulting string, Progress:
- Displays the first double-byte character.
- Notices that only one column remains before the hyphen formatting character.
- Inserts a blank in that column.
- Displays the hyphen formatting character.
- Displays the second double-byte character.
- Displays the third double-byte character.
- Notices that no more space remains.
- Decides not to display the fourth double-byte character.
Allowing only single-byte formatting characters
Format strings cannot contain multi-byte characters. In the previous example, in the
“xxx-xxxx“format string, thexand the hyphen are single-byte characters. The following format string, which contains a double-byte character followed by two single-byte characters, is invalid:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |